package com.example.coursehub.service;

import com.example.coursehub.entity.Chapter;

import java.util.List;

public interface ChapterService {
    Chapter createChapter(Chapter chapter);
    Chapter updateChapter(String chapterId, Chapter chapter);
    void deleteChapter(String chapterId);
    Chapter getChapterById(String chapterId);
    List<Chapter> getChaptersByCourseId(String courseId);
    List<Chapter> getAllChapters();

    /**
     * 获取学生已学习的章节
     * @param userId 用户ID
     * @param courseId 课程ID
     * @return 已学习的章节列表
     */
    List<Chapter> getLearnedChaptersByStudent(String userId, String courseId);

    void markChapterAsFinished(String userId, String chapterId);
}